import React from 'react';

var styles = {
    'title': {
        width: 200,
        display: 'inline-block',
        marginRight: 10,
        verticalAlign: 'top'
    }
}

class AppSearch extends React.Component {
    handleSubmit = (event) => {
        event.preventDefault()
        let title = this.refs.title.value
        this.props.SearchTodoItem(title);
    }

    render () {
        return (
        <form className='ui reply form' onSubmit={this.handleSubmit}>
            <div className='field' style={styles.title}>
            <input type='text' placeholder='Search' ref='title' />
            </div>

            <button type='submit' className='ui blue button'>
                搜索
            </button>
        </form>
        )
    }
}

export default AppSearch;